]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Ignore focus changes caused by tray showing/hiding
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 24 Sep 2012 15:02:13 +0000 (17:02 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 25 Sep 2012 06:25:25 +0000 (08:25 +0200)
The keyboard is shown/hidden automatically when (un)focusing a
ClutterText actor. This behavior breaks with the message tray now
grabbing/releasing key focus when toggled. Fix this by ignoring
all focus changes to or from the message tray.

https://bugzilla.gnome.org/show_bug.cgi?id=683546

js/ui/keyboard.js

index 723f89a2efd48aaf6f0eaadb690ee035c2db0549..5d62a7ef0d201903cdd9434579db930445023b3c 100644 (file)
@@ -200,6 +200,7 @@ const Keyboard = new Lang.Class({
         this._impl.export(Gio.DBus.session, '/org/gnome/Caribou/Keyboard');
 
         this.actor = null;
+        this._focusInTray = false;
 
         this._timestamp = global.display.get_current_time_roundtrip();
         Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._redraw));
@@ -291,6 +292,12 @@ const Keyboard = new Lang.Class({
         if (focus && (focus._extended_keys || (focus._key && focus._key.extended_key)))
             return;
 
+        // Ignore focus changes caused by message tray showing/hiding
+        let trayWasFocused = this._focusInTray;
+        this._focusInTray = (focus && Main.messageTray.actor.contains(focus));
+        if (this._focusInTray || trayWasFocused)
+            return;
+
         let time = global.get_current_time();
         if (focus instanceof Clutter.Text)
             this.Show(time);